package xinxin.com.MediatorPatternBasic;

import xinxin.com.MediatorPatternBasic.Colleague.Detail.ConcreteColleague1;
import xinxin.com.MediatorPatternBasic.Colleague.Detail.ConcreteColleague2;
import xinxin.com.MediatorPatternBasic.Mediator.Detail.ConcreteMediator;

/**
 * @author ：史鑫鑫
 * @date ：Created in 2019/4/1 20:53
 */
public class MediatorPatternBasic {
    public static void main(String[] args) {
        ConcreteMediator mediator = new ConcreteMediator();

        ConcreteColleague1 colleague1 = new ConcreteColleague1(mediator);
        ConcreteColleague2 colleague2 = new ConcreteColleague2(mediator);

        mediator.setColleague1(colleague1);
        mediator.setColleague2(colleague2);

        colleague1.send("吃过饭了么？");
        colleague2.send("没有呢，你打算请客？");
    }
}
